# -*- coding: UTF-8 -*-
from xpinyin import Pinyin
import random
import string

def ranstr(num):
    salt = ''.join(random.sample(string.ascii_letters + string.digits, num))
    return salt

# 城市中文转拼音
# def getcity(str):
#     reslist = []
#     one = [str.split('、')]
#     for i in one:
#         for j in i:
#             p = Pinyin()
#             reslist.append(p.get_pinyin(j, ''))
#     return reslist
def getcity(str):
    p = Pinyin()
    res = p.get_pinyin(str,'')
    return res